#!/usr/bin/node
//修改文件所有者
const fs  = require('fs'),
      err = console.error,
      uid = process.argv[2],
      gid = process.argv[3],
      src = process.argv[4];

if(process.argv.length != 5) {
  err('命令行参数不正确！');
  process.exit(1);
}

//node 16- uid:gid file
//麻烦，冒号改空格
//
//node 16- uid gid file

try{
  fs.chownSync(src, Number(uid), Number(gid));
} catch(e) {
  err(e.message);
  process.exit(2);
}

